If we seek to understand and learn from history we need to configure our mindset to the historical period. One can't learn from history without considering the ideas and perceptions held at that time.
Foucault calls these ideas and perceptions episteme.
Without knowing the episteme of the historical period we will learn history in a disconnected and disdainful way. We would come to view our predecessors as either stupid or cruel.