What did it mean?
In the 18th century and in the context of the 2nd Amendment, “well-regulated” meant well-practiced and of good discipline...hence the use of the term “regular” (such as the “British Regulars”, aka the “Red Coats”) when describing the foot soldiers of the day.
So in the context of the 2nd Amendment, the Founding Fathers aren’t saying that a “heavily restricted” militia is necessary to the security of a free state. They are saying that a “well-practiced” militia is.
Regulated as to the militia meant well trained, integrated and co-ordinated. Essentially an effective fighting force.