Commander is a rank used by the service organizations of many civilizations.
On Earth, this rank has a history dating back to at least the 20th century to the old seagoing navies, and has equivalents used by numerous species and cultures on several planets. The rank of Commander is superior to a Lieutenant Commander but under a Captain.
In Starfleet, a prerequisite to becoming a commander is by taking the Bridge Officer's Test. As commanders prove their leadership ability over time, they are considered for the difficult and highly competitive promotion to captain.