Ballpark factor, at its most basic, takes the runs scored by Team X (and its competitors) in Team X's home ballpark and divides the figure by the runs scored by Team X and its competitors in Team X's road contests. Often times, that number will be ever-so-slightly adjusted if a team doesn't play the same opponents at home as on the road.
For example: In 2018, 849 runs were scored at Coors Field, and 676 runs were scored in Rockies games away from Coors Field. Coors Field had a park factor of 1.271, when looking at runs scored.
The same exercise can be done with other stats, such as home runs, triples, doubles, etc.
Why it's useful
Park factor is a great way of determining the extent to which a stadium favors hitters or pitchers. It isn't affected by the teams or players involved, because those teams and players are also playing games in other stadiums. It simply compares how easy it is to score, from one ballpark to another.
It's important to know where your players' games will be played and how that might affect their performance. Park factors can also be determined for singular statistics such as home runs. So a player who plays his games in a park with a high home run factor is likely to hit for more power than usual. Knowing the effects of a ballpark can be useful for streaming players -- especially pitchers, whose results tend to vary depending on the stadium they're pitching in.