Hey there!
Unfortunately, your question is based on a false premise. The Communist Party of Germany (KPD) wasn't formed until december 1918, by leftist members of the older Social Democratic Party (SPD), which most likely is the organization you were thinking about when you posted your question :-)
The emergence of Communist parties all around the world starting in 1917 is directly linked to dissatisfaction among leftist circles with the socialist parties that had dominated working class politics in previous decades (among other reasons, due to their failure to oppose WW1, when they didn't outright support it), and to the success of revolutionary politics in Russia (the Russian revolution of 1917).
I'll leave to someone more knowledgeable to answer you about the SPD and it's history during Imperial Germany.