Aut cum scuto aut in scuto
It was once a Prussian city, founded by the Teutonic Knights in 1255. Even though the capital was moved to Berlin in 1701, it continued to be where Prussian kings were crowned. In 1945, the Soviets expelled all Germans that hadn't fled before the advancing Red Army. Many died. Stalin moved in Russians, so now there's this isolated enclave of Russians on the southern Baltic coast.
It may be 'isolated' but it's a forward base to keep an eye on the 'goings-on(NATO) in the Baltic.
Not just to watch. It's an advance base and almost certainly has IRBMs based there.
It’s also Russia’s only warm water port on the Baltic and that’s the main reason. Stalin wanted to keep Danzig but had to settle.