One square kilometre is exactly 100 hectares. The factor is a hundred and not a thousand, because a kilometre is ten times the hectare's hundred-metre side and ten squared is a hundred.
About the units
Both units describe land at scales above the building, and they divide the work between them: hectares for fields, forest stands, farms and reserves; square kilometres for municipalities, catchments, national parks and countries. The hectare is a square 100 m on a side, 10,000 m². The square kilometre is a square 1,000 m on a side, 1,000,000 m². Dividing those gives a hundred. Neither is formally an SI unit — the hectare is accepted for use with SI, and the square kilometre is simply the square metre with a prefix applied to the underlying length.
The exact factor
The factor is exactly 100. The derivation worth keeping is the one through side lengths: 1,000 m ÷ 100 m = 10 in length, and 10² = 100 in area. Writing it that way makes the whole metric area family consistent, since the same logic gives 10,000 m² to the hectare and 1,000,000 m² to the square kilometre. The common error is to assume the factor is a thousand by analogy with metres and kilometres, which overstates the hectare count tenfold.
Where you meet this conversion
Forestry and agriculture at national scale. A country's forest area is reported in square kilometres or in millions of hectares, and the two figures for the same country differ by a factor of a hundred, which is a documented source of confusion in secondary reporting. Land use change, deforestation and reforestation statistics are published in hectares by the FAO and in square kilometres by many news outlets. Protected area designations and municipal land registers use both, often within the same document.