Originally, in England, a (usually) noble (always) wealthy individual was given a royal commission to provide troops to the king. This meant that he went out and recruited men, provided arms, uniforms, and training, and was paid a set sum per man, from which he recouped costs and paid the soldiers*, and served as colonel of the resulting regiment (many of the older British regiments have their earliest titles as Col. So-and-so’s Regt.). The colonel, and certain specified officers under him, held the king’s commission(s) to raise and command the regiment, and came to be known as commissioned officers.
(* Often supplemented by the colonel out of his own pocket to provide fancier uniforms, regimental band, and other amenities.)
Other officers (corporals and sergeants) were appointed directly by the regimental colonel from the enlisted ranks, and came to be known as non-commissioned officers (NCOs) to differentiate them from the higher-ranked commissioned officers.
Warrant officers were originally technical specialists, such as artillerymen or doctors, who were people who handled important matters which couldn’t be done by commissioned officers for various reasons (usually snobbery - cannons were low class things that a real gentleman didn’t dirty his hands with). This was handled by giving them a warrant from the appropriate technical office authorising them to act as gunners, surgeons, etc. They came to be known as warrant officers. Generally, their authority was specifically limited to their technical area, so that a warrant gunner could command artillerymen, but was outside the normal command structure and therefore had no authority over the lowliest infantry private.
The military is very conservative in some things, so as the original organizations adapted to changes over time (and to the different evolutionary path followed by the American army), the actual legal source of authority and roles played by various ranks changed again and again, but the rank titles remained much the same. Warrant officers in both British/Commonwealth and US armies are presently an intermediate rank filling a gap between the commissioned and non-commissioned officers, although the US seems to see these as junior commissioned officers while the British/Commonwealth sees them as senior NCOs.
As an aside, this system persisted well into the 1800s for the Royal Navy. While Royal Navy commissioned officers were appointed by the Admiralty (the king signed the commission, but the Admiralty provided the names of qualified people to receive the commissins), all the technical stuff was taken care of by warrant officers appointed by various technical boards. Surgeons held warrants from the Sick and Hurt Board; masters (responsible for ship handling and navigation), bosuns (responsible for deck operations and sail handling), and carpenters held warrants from the Navy Board; pursers (responsible for food, clothing, and similar supplies) held warrants from the Victualling Board; and gunners (reponsible for gun maintenance, the powder magazines, etc.) held warrants from the Ordnance Board. See The Admiralty for more info on this. When steam engines were introduced, engineers were originally appointed as warrant officers.