Queen Mary was born as Her Serene Highness Princess Victoria Mary Augusta Louise Olga Pauline Claudine Agnes of Teck at Kensington Palace in London.
Her father, Francis, Duke of Teck, was born as Count Francis of Hohenstein to Duke Alexander of Württemberg and Countess Claudine Rhédey of Kis-Rhéde.
Since Countess Claudine was deemed of insufficient rank for her husband, the marriage was deemed morganatic, which meant that the children were not dynasts (meaning they had no succession rights to Württemberg) nor did they become dukes and duchesses of Württemberg. The children first were given the titles count and countess of Hohenstein and later prince and princess of Teck. Queen Mary's father, the only son of the union, was later raised to the title Duke of Teck, with all other members of the Tech family carrying the title prince or princess.
Württemberg was a state in Germany which existed in the following forms:
County of Württemberg (1089-1457)
Duchy of Württemberg (1457-1803)
Electorate and Duchy of Württemberg (1803-1806)
Kingdom of Württemberg (1806-1918)
In 1806, Frederick III, Elector of Württemberg (who was formally Frederick III, Duke of Württemberg and Elector of the Holy Roman Empire) assumed the title of king. It was at this point that the royal line started. His brother, however, was not the son of a king and therefore he remained a duke. It was from this ducal line that Queen Mary's family came from.
The royal line is now extinct and therefore the ducal line represents both the ducal and royal heritage. The morganatic Teck family, which became Cambridge after 1917 in the UK, is extinct, however.
The Battenberg family has different origins... They are morganauts as well but they are descended in the male line from the Grand Dukes of Hesse and by Rhine. They originated with the union of Prince Alexander of Hesse and by Rhine and Countess Julia von Hauke. She and her issue were first Counts and Countess of Battenberg but later raised to the rank of Prince and Princess.
In 1917 in the UK, they too relinquished the use of the German titles and took the name "Mountbatten". The current Queen's husband, Prince Philip, Duke of Edinburgh, is the son of Princess Alice of Battenberg, although she never bore the name Mountbatten. He took the name as a tribute to his uncle, I imagine, but he initially wanted to use the name "Oldcastle", which is an anglicization of the House of Oldenburg, the family to which he belongs.