JJ is not completely right.
Not all knights were land owners. Some were not rich enough to buy their own armour and horse. Of course some knights were land owners but no all of them, many of them were not.
A knight not wealthy enough to own land or even a house/mansion had no choice but to put himself into the service of someone else, as a bodyguard or a trainer for example. It could be the service of a lord or a wealthy merchant for example.
Armies were not entirely made of knights. The battle of Crecy for example gathered for than 2,000 knights on one side, not a even close to the half of the army., When entering a state a war, a knight called his vassals ( lords under him ) to raise the army. The army was mainly peasants or/and artisans, given weapons ( all kind, from rusty swords to chunk of woods ) and very quickly ( or not at all ) drilled. These men were not always paid but given the freedom of loot if they survived. They were the main force of an army. If they survived, they would go home after the war with what loot they could have gathered, until the next war.
COntrary to some nations of the antiquity, most nations/kingdoms,...Etc had not professional armies. They just were men gathered in time of wars.
As centuries passed and knighthood evolved, it became easier ( for nobles and wealthy people ) to be a knight. The virtues attributed to them changed, some people went to buy knighthood ( rarely officially of course ). This is why the purpose and role played by knights also evolved, from the virtue to protect the weak and poor, many knights were just knights to seek personal glory and wealth ( not always of course ).
Seeing 2,000 knights in one army was rare but it happened. I can't tell for sure what is the record of knights present in one battle ( these kind of documents were not kept back then, only the most famous knights or knights from famous families were really recorded, or those who made great deeds. Many knights are forgotten from all documents and will never be known to us ).
So no not all knights were land owners. As I said, many had no other choice to put themselves into the service of someone else since they could not even afford an armour ( a complete set of heavy armour costed a fortune for the time, since they had to be made for your body ). This is why for example many saw the crusades as an opportunity of wealth or many gathered into errant knights, often becoming brigands and bandits for examples.
In feudal society, the King was indeed ( as JJ said ) the man with the largest army because his vassals had the duty to provide him money and men in times of war ( in exchange for example of protection ). Lords though ( counts, dukes, barons among others ) had the right most of the time to raise their own armies to fight or protect themselves from a neighbour for example. ).
With time going on and pure feudalism dying to let the place to state ( it started in the Renaissance for many countries ). Many nobles lost their power which went to the King or Queen ( more and more closer to the absolute monarchy ) and when war was coming, they raised men with conscription, massive conscription of men from a certain age and often randomly designated in villages and towns ( like a lottery pretty much, you were attributed a number for example and your number was chosen so you had to go ). It looked more and more like a national levy of men. Military service also started to appear in some countries ( Kingdoms, Republics, large independant Dukedoms,...Etc ).
But during the Middle-Ages, men were just raised most of them among the peasantry. It was a duty you had towards your overlord in exchange of protection. You were rarely paid and taxes for your family were raised ( during wars, the taxes are almost always raised because it is expensive to create an army, a lord may have had to hire mercenaries, provide food to the army, pay for ransom and alliances,...Etc ) but you were mostly free to loot. With a bit of luck, you could be knighted ( this war rare for a peasant or simple low man but it happened ) but you will be an example of a poor knight because you were a low-born man.