Many generations ago, almost countless, a few disputes between people caused a blast of tension. These people split up into two groups, which they decided to then call "teams". The teams were led mostly by teenagers, though adults taught, cooked, and looked after children younger than 10 years.
After years of debate over the names of the teams (of all things), the leaders of the two teams decided to split again and became four. Team Moonrise and team Sunrise, despite their largely obvious differences, which were clear to anyone both then and now, had once been a single team, while teams Sky and Starlight, who are quite a bit alike even today, had also once been a team.
Fights, no, wars have been broken out over things both stupid and reasonable. The teams survive with what resources they have for the most part, and it's a rare thing to find a patrol in your team's castle asking for something, but it's certainly not something unheard of.