If she feels anxious or on the alert while outside then petting could cause her to feel overstimulated. For cats just being around you is a way for them to show affection, so if she doesn’t like being overstimulated that may be why she’s avoiding physical affection. Try just letting her sniff your fingers and maybe rub herself against you, and if she let’s you, keep the petting to just her head if she’s alright with that much. Then let her leave if she wants to. If even that much is unwanted then that’s okay, just avoid petting her. Being near you seems to be enough for her. But it is definitely a sign that she cares about you, if she follows you the whole way.
I mean for me motivation is heavily influenced by my energy level.