Disclaimer 1 : throwaway account
Disclaimer 2 : Most of this is from memory, as I've worked on the subject of Smart TVs a couple of years ago.

Now, this comment is about TVs, not computer/streaming/whatever. It should give some pointers for people who want to understand how we got there.

First a bit of context (feel free to skip this step) :

First of all, there are several competing standards for digital television. Major ones are DVB (Europe, Africa, part of Asia), ATSC (North America) and ISDB (Japan, South America), China has its own thing (DTMB). Then, there are several ways to distribute it : by Cable (DVB-C, ATSC-C, ISDB-C), by air (ground antennas, named Terrestrial) (DVB-T, ATSC-T, ISDB-T), by Satellite (DVB-S, ATSC-S, ISDB-S) and lastly by IP.
Not everything is supported, of course. Your US Smart TV won't be able to pick up EU channels, because the tuner is not the same.
Now, historically TV was a one-way communication : broadcasters sent content, which was picked up one way or another by your TV.
Then broadcasters tried to make the TV experience more interactive. I won't speculate about the reasons, but fact is that : early 2000-2010, lots of standards popped up to add interactive capabilities to a television. Things like DVB-MHP (also called DVB-J), ATSC packages, MHEG 5, DAE, ...
Now (2019) things are more or less settled in the Western world: DVB regions use HbbTV, ATSC 3.0 regions use ATSC 3.0 apps (they have no names).

Interactive TV :
But what is "interactive TV" anyway ? You can already interact with your TV, that's called a remote control. Well, with those interactive TV applications, you can interact with the channel. If you a little rectangle prompting you to press one of the color button (typically, the red button) of your remote to get more information on the current channel, or access to additional content, that's an interactive application being executed on the TV.
In HbbTV and in ATSC 3.0 apps, those are Web apps (bunch of HTML/CSS/JS files + some resources) executing on your TV when you watch a channel.
Now, as a broadcaster, how do you broadcast those application to the TV ?
1. You pack everything into the stream and the television executes it ; there are ways to do that. It's like a pure client-side application.
2. You tell the television to fetch it remotely. This way, the television asks to something else for the content. The TV no longer is a dumb receiver, it must also be able to contact to the world.

The back channel :
This communication interface with the world is referenced as the "back channel" (or "return channel") in specifications. In DVB world, the back channel is an Internet connection : whether Ethernet or Wi-Fi. In ATSC 3.0 world, I can only speculate (I've only skimmed through the specs). From my understanding, you still can do it the IP way (Ethernet/Wi-Fi), but there is a specification for another way of communication (may be over cable/radio), credits to tenebrisalietum for pointing that out in the comments.

And what about advertising ?
Again, I won't make any hypothesis about why broadcasters want targeted ads. Fact : In recent years the DVB group and HbbTV association has thought about targeted advertisement. The working group was named DVB-TA [1].
If you have a TV which is able to execute arbitrary applications from broadcasters for one, to fetch remote content over the Internet for two and if you happen to have a profile for the users of a specific TV set, then it is a not too hard for a broadcaster to create an interactive application that will replace every "generic advert" broadcasted by a more targeted one.

As stated, all Smart TVs today fulfill point one, they may fulfill point 2 if they're connected to the Internet or have an alternative back channel. For point 3, I only _suppose_ that broadcasters have ways to build profiles on their viewers.

Other interactions :
There are other types of interactions which are part of the specifications. Things like Companion Screen, where the TV communicates with a smartphone/tablet. Usually it involves downloading the application from the TV manufacturer. There are also some specifications which detail some interactions between smartphone and TVs (though some of it is also vendor-specific). On the technical side, the two devices must share the same local network and everything is done in UPnP.

Generic applications :
Smart TVs also have app stores, where you can download and execute applications for the TV's underlying operating system. Android TVs have Android apps, Samsung TVs have Tizen apps, LG TVs have webOS apps, ... Those are not the same as "interactive applications" mentioned above (interactive applications are transmitted/signaled over the digital television stream, you don't get them from an app store).

Security and Privacy state of the art by memory :
Research on the subject focused on DVB and more specifically HbbTV. wrt security, the two founding presentations were by Herfurt in 2013 at 30C3, then by Oren et al. at Usenix Security 2014. On the privacy side, Ghiglieri et al. published multiple studies regarding the use of tracking technologies inside HbbTV applications.
To the best of my knowledge, there has been no independant presentations that looked into ATSC 3.0 interactive applications security or privacy implications. (You can find related talks from the people who wrote the standards)

[1]: https://www.hbbtv.org/wp-content/uploads/2018/11/11_Angelo-P...