Each star is a State. In the 1860's we only had 26 stars to represent the Union. The south represented 13 stars in their battle flag which were the amount of states in the rebellion. The North or the Union kept all the stars, President Lincoln refused to reduce the stars in the flag because he wanted to preserve the Union So the North had all the states represented in their flag, to include the Southern States, 26 stars.
It is a one of the errors in some historical movies. Count the flags in a WW II movie. If it has 50 stars, something is wrong. We did not have 50 stars till the late 1950's, those were Alaska and Hawaii.