I think that you want in to the strongest university IM program you can get into. Even if a program takes 4-5 of its own (which would be a VERY high number, by the way) if you're in a class of 30 or 40 or 50 interns, that might not be as many as you think...if 9 or 15 people want cardiology, that's a <50% chance for you. If the program has a crappy rate of matching people "out" for cards, that suggests the program either isn't strong and/or they don't support their applicants, or the faculty are not well connected.
If you are choosing between programs of fairly similar academic strength, then I think it makes sense to pick the one that has a more well known cardiovascular medicine division, and/or one that does tend to keep more of its own residents for cards fellowship. In other words, say you have a choice between 2 midtier uni programs. One has 8 cards fellowship spots/year and always keeps 3 or 4 of its own people, while the other only takes 1 or 2. I'd pick the 1st program. Or if you have 2 programs, similar academic quality but one place is more known for hem/onc and ID and the other for cardiology. I'd pick the 2nd program because it's not just the overall strength of your IM program that helps you get fellowship, and it's not just what YOU personally do, it is the perception of cards fellowship PD's about the training you've received, and their perception of the folks writing your LOR's. I also think that places that see/admit more sick cardiology patients are going to give you better training, so if you want to do cards, don't go to some place that has a little wimpy ICU with only 8 beds, or that has few ICU months.