The same way Wilhelm inherited the title Kaiser. Somebody before him assumed the title, and it became a standard word for the ruler in related languages/lands.
Tsar ... is a title historically used by Slavic monarchs. The term is derived from the Latin word
caesar,
[2] which was intended to mean
emperor in the European medieval sense of the term—a ruler with the same rank as a Roman emperor, holding it by the approval of another emperor or a supreme ecclesiastical official—but was usually considered by Western Europeans to be equivalent to "king".
Tsar and its variants were the official titles in the First Bulgarian Empire (681–1018), Second Bulgarian Empire (1185–1396), the Kingdom of Bulgaria (1908–1946), the Serbian Empire(1346–1371), and the Tsardom of Russia (1547–1721). The first ruler to adopt the title
tsarwas Simeon I of Bulgaria.
[Halfway through his reign, Simeon assumed the title of "emperor" (
Tsar)]
With respect to Russia specifically:
The title-inflation [the assumption of being tsar] related to Russia's growing ambitions to become an Orthodox "third Rome", after the fall of Constantinople in 1453. The monarch in Moscow was recognized as an emperor by Holy Roman Emperor Maximilian I in 1514.
So one soi disant Roman emperor recognized another.