Strange as it may seem, honey direct from the hive needs to be treated carefully to ensure it will keep well.
Honey is composed primarily of sugars and water and will degrade over time if it is not completely capped at harvest time. Uncapped honey will still have too high a percentage of moisture to keep well. Honey is also hydroscopic (will absorb moisture) so it is important to keep your honey in airtight containers.
It is important that the moisture content is below 18%. This can be checked with a refractometer. Moisture allows the development of micro-organisms such as yeast that start fermentation.
The moisture content can be removed by a special moisture removing machine or by leaving the honey uncovered in a sealed room with a dehumidifier.
Pasturising is a process to remove the micro-organisms by heating the honey to 78°C then cooling. This process is used by some honey producers but also means the honey loses some of its nutritional qualities.