Armies had a lot of more or less professional infantrymen, be they in the retinue of a lord or knight (and they could be peasants even if a peasant would generally have no reason to go to war, and the lords would have few motivations/legal means to constrain serfs to go), mercenaries (https://en.wikipedia.org/wiki/Free_company), or common-law prisoners (a bit as the Russians did in Ukraine).
Free families would often have to send someone to war if the local lord called.
In the medieval era in Europe few were generally professional, in the sense that it was their full time job even in peacetime. Like you said the Kings retinue would be one of the few exceptions. Since the collapse of the (Western) Roman Empire there just wasn’t the concentration of resources in Europe for maintaining standing armies. Most were effectively a reserve force, somewhat akin to the. National Guard in the US hat could be “called up” in the event of a war.
Military mercenary companies were absolutely a thing (probably as early as 10th century, although they were also definitely a thing during the Roman empire), but they were very different from your typical peasant.
Conscription and Mercenary companies became more prevalent as the scale of warfare increased, and the early gunfire which necessitated coordinated volley fire.
Free families would often have to send someone to war if the local lord called.