Mackenzie originates from a settlement west of Nuka-World. Sometime before Nuka World's Overboss Colter took over the theme park, his gang attacked Mackenzie's settlement. She successfully negotiated a ceasefire in order to tend to the wounded on both sides, including Colter himself.
After Colter secured the theme park, he returned for Mackenzie and offered her a deal: work for him and his gang would leave her settlement alone. She accepted his offer, put on an exploding shock collar, and works as Nuka World's doctor in the Nuka-Town market.