How is XP shared between multiple teammates attacking the same wild Pokemon?
Yes, it has a last hit mechanic.
From my testing (I'm a master ranked player), all participants who attack wild Pokemon/other players gain about half of the experience that last hits give (when the damage occurs in a timeframe, I have not tested the exact timeframe). This includes gaining experience from wild Pokemon that the other team kills (except for objective experience).
So everyone who damages a wild Pokemon will get a share of the exp, and the last hit gives additional exp.