King in Prussia was the title used by the rulers of Prussia from 1702 to 1772.
The rulers, who were also Princes and Margraves of Brandenberg wanted to be Kings, but knew that the Holy Roman Emperor would not allow them the title.
In return for support in the War of the Spanish Succession Emperor Leopold I allowed Frederick to call himself King in Prussia. The Duchy of Prussia was outside the Empire, and he was only regarded as King outside the Empire.
In 1772 Frederick II annexed most of Poland and decided to call himself King of Prussia. The Holy Roman Emperor was not as strong as they had been, and in 1806 the Empire ceased to exist.