Sounds like a PO did not know how to install the toilet.
Yes there is supposed to be a water connection on the rear of the toilet. This connection is to go to a water line from your water supply.
The sprayer is supposed to connect to the toilet, not the water line.
The sprayer provides two purposes, obviously, one is to clean the bowl with higher pressure than the auto flush. second, the sprayer is supposed to use less water than the autoflush.
There should be two portal on the back of the toilet, one for the supply and one for the sprayer. The foot pedal opens auto flush valve and the sprayer head works just like a sink sprayer, it diverts the water from the bowl to the sprayer head when pressed.