Pop up sprinkler rotation
Here's a sketch of a typical plastic pop-up sprinkler (www.irrigationtutorials.com):


If the parts fit very loosely, especially the nozzle onto the riser, one could imagine that it might rotate a little bit and work itself looser with each operating cycle.

Rotation can occur in at least three places:


where the nozzle screws onto the riser
where the riser section slides in the body (not the rotation of the cap)
where the body inlet screws onto the piping below


The place where the riser section fits into the body is typically splined. The screw-on cap holds the riser into the body, but the riser can't rotate because it is engaged with those splines inside the body.

First tighten the two threaded connections appropriately (the nozzle onto the riser and the body onto the supply piping). Finally, unscrew the capg, rotate the riser until it's as close as possible to the direction you prefer, and tighten the cap. Rotate the body-to-pipe connection a little bit if needed to fine-tune the direction.