Under normal conditions, water travels only one way: out of the municipal main and into a house or an irrigation system, never back the other direction. That direction can reverse for a moment when pressure in the main drops unexpectedly, and on an unprotected connection, whatever the irrigation side happens to be touching could get drawn backward toward the same supply reaching your kitchen faucet. The backflow preventer’s entire job is blocking that reversal before it ever reaches the drinking-water side.
Most municipal codes require one on any irrigation system tied into city water, and beyond simply having the device installed, many places also require a qualified professional to check on a set schedule that it is still actually sealing shut. Irrigation drawn from a private well instead of the municipal main sits under a different set of rules entirely, and sorting out which situation applies to a given property is worth doing rather than assuming.