A short walk north of Himeji Castle, the Hyogo Prefectural Museum of History gives useful context for what you have just seen. The permanent exhibition covers the prefecture from prehistory to the modern era, with a particular focus on the castles of the region — Himeji is one of several feudal strongholds in Hyogo, and the comparison makes the famous one more legible.
The building itself, designed by Kenzo Tange, is a piece of modern Japanese architecture worth a quick look from outside. Visit before or after the castle for the full picture; the entry fee is negligible.