It started when our manager gave me a project that this coworker struggled to make progress on (the transition was made in a way that allowed the coworker to save face, if he wanted to). Prior to that, he tried to talk to me as though he was a mentor, which I mostly just nodded at - some of it was useful, at least at first. After the project transition though, he complained that I made gratuitous style changes, opened several PRs to try to fix the problem before I could and then in response to my code review publicly told me that he had more experience than me so maybe I should listen to him.
All of that might be attributed to his own self-consciousness if it weren't for the fact that he was deferential to male engineers in code review, and during the height of the tension with me, during scrum he started openly criticizing/mocking a female contractor's work (on an entirely unrelated project that he knew very little about).
This is a pretty egregious example, but I could imagine that a much subtler version happens more often (possibly it's happened to me but it seems more pragmatic to assume it's not related to sexism if at all possible).