I can explain it to you but it is not a simple process. Rather one with lots of options depending on the ad package and the MSO's involved.
Here goes-
A TV program, say a 30 minute commercial show is actually standardized to a 28:30 run time. This allows at least some ad time between two shows plus the channel ID and MSO ads. The 28:30 show itself is often divided up into segments separated by "commercial breaks" with several 30 to 60 second spots.
These spot breaks have a number of different options as follows-
1. Spots that are part of the main show, like an infomercial with repeated 30 second "calls to action"
2. A national spot that has nothing to do with the show, likie a Ford commercial, inside a fishing lure infomercial.
3. A local spot that is inserted locally for a local business.
In a simple sense this about coveres the categories. Now here is how it is done-
The show airs and the first break comes up and the show spot airs first because it is embedded into the tape of the show. But the next spot that in the break when the show originates from say DirecTV, will have a national promotion for DirecTV. Depending on how the spot is sold, it can air on all shows including when that show airs on Dish Network, Comcast etc,, or be restricted to just a target of DirecTV airing. If the national spot is a restricted national, there is always a backup national embedded that can run too. I have done these in this format but have never done multiple restricted nationals in a show. It is possible but I'm sure the billing would be difficult.
Now while the local spot time comes up the show often will have a place marker. While btroadcast networks adhere to traditional standards for these MSO's all seem to operate different in that I have seen a cue sheet required that permitted a MSO to expand or shrink a show with the breaks and local inserts. Local broadcast and networks mostly stick to a standard and do not do that.
Now here's how the MSO national feeder NBC or even Comcast will work the local spot insert-
When the show runs and the time for the local comes up, a tone is sent from the network to the cable or dbs company that triggers a local server or head end carte machine to insert the spot. In most cases cable inserts are sold on a broad scale random insert and are documented as to what was inserted using an FCC regulated affidavit report at the end of the month. If you buy time for local inserts of your spot, you will buy it from cable as a package, like 100 30's per week inserted into all local designated slots on a channel package like-
CNN History channel, MSNBC, FNN, Discovery, etc. You get no choice as to when and what show it will insert to. You won't even know until the affidavit is released and then tghat affidavit will give you how your 100 spot budgetr was spent. You can buy these packages direct from Cable or from the MSO but if you want to guarantee a specific insertion the MSO will usually send you to the show producer directly.
Presently, I do not accept other spot inserts in my shows but we do make available rotation inserts to other channels, like History
MSNBC CNN etc. I have no idea when one of my spots will air in your cable system's CNN channel. Cities I currently sell rotation inserts to are Richmond, VA, Norfolk, VA, Florida and Savannah GA. but not NYC, or others. If you have cable in these markets, and watch "CNN or TNT etc. no doubt you have seen my work.