The Habsburgs are descendants of the Etichonids, who were a Germanic noble family that lived near the Rhine river, the Etichonid family was founded by Eticho who was the Duke of Alsace until his death in 683. The Etichnoids were the ancestors of many prominent families, such as the Carolingians, and the Habsburgs.
One of the descendants of Eticho was Radbot. Radbot was named as the count of Klettgau by Ernest II Duke of Swabia in 1016. Radbot built a castle in his county which was called Habsburg castle this is the castle that the Habsburg dynasty takes its name from. The castle is located in current day Switzerland.
The original name of the castle was probably Habichtsburg, which means Hawk Castle in High German. Over the years the name changed until it became Habsburg. The first person to call himself the Count of Habsburg was Otto II of Habsburg, who was the grandson of Radbot.
The Habsburgs remained an obscure dynasty until Rudolf I was elected as the King of Germany in 1273, since Germany at the time had an elective monarchy, where a group of prince-electors would choose the new king after the previous King died. Rudolf managed to secure his election by bribing the prince-electors.
During his kingship he succeeded in creating the duchies of Austria and Styria which he gave to his eldest son Albert I who also eventually became the King of Germany. The Habsburgs continued to be the Dukes of Austria, and were also intermittently elected as the King of Germany, and the Holy Roman Empire.
The next major title the Habsburgs acquired was the Duchy of Burgundy, which is located in current day Belgium and Netherlands. Charles the Bold, who was the Duke of Burgundy at the time had no sons, so his Duchy was inherited by his daughter Mary of Burgundy in 1477. Mary was married to Maximillian I, who was the son of Frederick III, who was the Archduke of Austria and the Holy Roman Emperor.
After Mary died her son Philip the Handsome inherited Burgundy. Philip married Joanna of Castille, who was the Queen of Spain. Their son Charles V eventually inherited all of his parents and grandparents titles.
So Charles became Holy Roman Emperor, King of Germany, King of Spain, King of Naples, Lord of the Netherlands, Duke of Burgundy, Archduke of Austria, Duke of Brabant, Duke of Lothier, Duke of Luxembourg, Margrave of Namur, Count of Charolais, Count of Zeeland, and a whole bunch of other titles.
Eventually Charles abdicated his titles in 1555 and left all of his territories in Western Europe to his son Philip II, and all his territories in Eastern Europe to his brother Ferdinand I.
The Habsburgs eventually lost Spain when Charles II died without any children in 1700. The Habsburgs lost Austria-Hungary when, they were removed from the throne in the aftermath of WW1.