The English fact comes from the Latin factum, meaning “something that happened.” It is thus an exact cognate to the Spanish hacer, meaning “to make.” How?
The root of both is the Latin facere, meaning “to do.” Fact, and the Latin factum, is just the same word in a different tense.
The Latin facere turned into the Spanish hacer, although they superficially sound different. Their relation becomes obvious once we remember that Latin words that began with an initial f- almost always turned into h- when Latin evolved into Spanish.
Therefore, the f-c-r of facere maps exactly to the h-c-r of hacer.
This pattern explains many words such as hierro/ferrari, hervir/fever, huir/fugitive, hoja/foliage!