A code, not an adjective — Every character of an IP code corresponds to a defined test with a defined probe. Nothing may be specified by the description alone - IEC 60529 says the degree shall be given by the numeral.
Anatomy of the code — Where a numeral is not required to be stated it is replaced by X. IPX5 says nothing about solid objects; IP6X says nothing about water.
First numeral: solid objects and access — IEC 60529, Tables 1 and 2. Note that 4, 5 and 6 all give the same protection against access: the difference between them is dust, not fingers.
Second numeral: water — Up to and including numeral 6, a designation implies compliance with all lower numerals. Above 6 it does not.
The trap
IK: the impact code — IEC 62262:2002, Table 1. IK is a separate code from IP - an IP66 enclosure carries no impact rating unless IK is stated as well.
What the code does not tell you — Specify the code, then specify the environment separately. They are different questions and only one of them is on the datasheet.