An Inspector Calls was written in 1946 but set in 1912. This means that there is a lot of opportunity for DRAMATIC IRONY - this is when the audience know more than the characters. There is lots of this in the first scene, when Mr Birling explains to the dinner party his beliefs on the world - that the Titanic won't sink, that there'll never be war, and that workers won't go on strike. For an audience watching this in 1946, all these predictions proved catastrophically wrong.
An Inspector Calls isn't just about the Birling family and an odd inspector. It's an ALLEGORY. An allegory is a story in which people and things represent bigger ideas and themes about life. The Inspector's speech near the end gives us the clue to this. 'One Eva Smith is gone, but there are millions and millions and millions of Eva Smiths and John Smiths still left with us' (56)
So, Eva Smith represents all poor and working class people who are being exploited. The Birlings represent all the privileged and wealthy upper classes who exploit them.
Priestley also tries to link the attitude and actions of the Birlings with the catastrophes of the First World War, the Second World War, and the plight of poor people in
All allegories have a moral, or a message. The message Priestley is putting across is that the system for running society that the Birlings represent is unfair and will lead to horrible conflict. The system the Inspector represents is much fairer. Broadly speaking, the Birlings represent Capitalism, and the Inspector represents Socialism. This is a controversial argument, and one that is still hotly debated today. But you don't have to agree with Priestley to understand his motives in writing the play.