There are actually two separate coding systems in play here.
IATA (International Air Transport Association) codes are 3 letters and are used for commercial bookings etc. They are assigned only to commercial airports throughout the world. ORD is the IATA code for Chicago O'Hare.
Pilots and ATC use the four letter ICAO (International Civil Aviation Authority) codes, which are assigned to every public-accessible airfield in the world. These are systematically allocated with the first one or two letters indicating the country. K is used as the first letter of airfields in the continental US (with separate codes for Alaska, Hawaii & territories in the Pacific/Caribbean matching regional standards).
Commercial airports in the continental US tend to have the two codes in matching pairs such as ORD/KORD, LAX/KLAX etc but this is not the case in other countries. Manchester, UK has IATA code MAN but ICAO code EGCC.
Meanwhile smaller airfields in the US may only have an ICAO code, where the corresponding IATA code (minus the K) could belong to an international airport elsewhere in the world (for instance KPRG is Edgar County Airport, Illinois and PRG is Prague Václav Havel Airport, Czech Rep.).
Finally, the very smallest airfields in the US (typically private/restricted access fields, in any case not large enough to warrant an ICAO code) are given a 3- or 4-character code by the FAA which extends the ICAO system by allowing digits as well as letters. Small public fields have a 3 character code (eg 9S2 or C97) while private fields have 4 characters which typically include the state abbreviation eg TX05.
For more details of the exact determination of which code type a US airfield is assigned by the FAA, see reirab's excellent self-answered question: How does the FAA determine which format of location identifier to assign to an airport?