What makes a swing state?

Wikipedia

State races by 2016 presidential election margin. Clinton won dark blue states by more than 8 points, medium-blue states by 4–8 points, and light-blue states by less than 4 points. Trump won dark red states by more than 8 points, medium-red states by 4–8 points, and light-red states by less than 4 points.

When it comes to election season, swing states are the element that keeps Democrats and Republicans alike on the edge of their seats. Yet, it can be unclear as to where this concept even originated.
Also called battleground states or purple states, swing states don’t always vote for the same party and are critical in predicting a presidential candidate’s success.
One key reason for the existence of swing states is the electoral college. With most states taking a winner-takes-all approach to the electoral votes, there is always one clear victor per state.
Another cause is population changes. Younger generations tend to lean more liberal than older people, so a generational shift will change the political climate. However, young people have a much lower voter turnout.
Many residents in swing states don’t vote strictly for one party, they merely vote for a candidate they favor. This causes constant shift and uncertainty when it comes to elections.
Moderate voters factor into this as well. Once again, they’re not voting for a party, they’re voting for a candidate.
Battleground states were formerly determined by how close the votes were per state, but now there are more elements at play.
Finding out what constitutes a swing state now requires previous results, opinion polling, and recent trends.
The thirteen states that qualified for this unofficial title during the 2020 election were Wisconsin, Pennsylvania, New Hampshire, Minnesota, Georgia, Arizona, Florida, Virginia, Michigan, Nevada, Colorado, North Carolina, and Maine due to how competitive their votes are during election season.
In the 2020 race, all but three of those states had within a five percent margin of victory.
Ohio was one of the more divisive states as of the most recent election.
While it does often play a significant role in predicting election results, the vote is not nearly as close anymore and tends to skew Republican.
Republican or Democrat, American voters can all agree that these battleground states leave them anxiously biting their nails when the election rolls around.