to expand on what rdowty said
arc is your friend
it stands for audio return channel
one port on the TV (HDMI 2 in my experience, it'll be labeled) supports sending audio out from the tv "backwards" down the cable.
then whatever audio is on the tv will go back down that HDMI cable to whatever's connected
If does mean one input is taken up for audio output, so if you've got a lot sources, you might run out of places to plug them.
on the bars with an in and out, you need to make sure that bar supports all audio and video formats you are trying to pass through, which can be limiting. Also it can only grab the audio of whatever is passing through, so if you route the aTV through the soundbar, then you won't be able to use it for the cable box.
on my tv (LG E6 OLED) there is an option for internal or external speakers, and can change back and forth as needed.
the remote (either TV or aTV) controls whichever is selected.
I just got the new Sonos beam, it's pretty solid, although it's a little more expensive at $400
but it's got...
-- alexa built in
--using airplay 2 you can send audio from any apple device directly to the bar without turning on the TV.
-- it's got it own on board media player that connects to many different services (Spotify, apple, google to name a few)
-- you can add a pair of speakers and they'll become surrounds (connect wirelessly, just need power)
-- you can add speakers (either singles or stereo pairs) in other rooms, and send the TV sound to that (can see the TV from the kitchen, but not quite hear it... this will fix that)
-- and it supports HDMI-CEC which allows the other remotes to control it's volume.