Okay, that cable is connected between the charging port assembly and the motherboard, as seen here.
[image|3252214]
You can't see it in your picture because it's under the metal shield covering the vibration motor. The other end connects to the charging port assembly; you can see it here.
[image|3252215]
So yeah there should be a connector on both ends. If you're missing the connector, look at where it's supposed to be plugged into and it should be there; unfortunately I wouldn't have much confidence in my ability to put that tiny connector back on the wire and have it connected correctly. I would strongly suggest that you should replace it with a new coax cable. You can use the charging port replacement guide to get to the coax cable; obviously you don't have to remove the charging port, just follow it along far enough to free the antenna cable.
[guide|136196|Google Pixel 4 Charging Assembly Replacement - iFixit Repair Guide|new_window=true]
I saw several places selling those two cables for the Pixel 4 XL, and those may work, but I'd suggest you stick with one explicitly for the Pixel 4. There were a couple of eBay listings, and here's one on AliExpress that would work (note that it comes in black, but the color of the coax cable doesn't matter).
[link|https://www.aliexpress.com/i/3256803628296456.html|Signal Antenna Flex Cable For Google Pixel 4 4XL 4a 4a 5G Signal Wifi Connector Wireless Line Ribbon Replacement Parts - AliExpress|new_window=true]
Good luck; let us know how it turns out!