Your bags will be checked through to Izmir, and you only have to go through immigration at Istanbul. Two hours is plenty for your connection, but immigration can take a significant amount of time. I have had to wait for more than an hour in line several times.
When you arrive in Izmir you need to transfer from the domestic to the international terminal to claim your baggage and clear customs. There will be somebody at the end of the jetbridge or just after who directs passengers who have connected from international flights onto a waiting bus.
I prefer to go through Munich on Lufthansa, because the connection there is easier than in Istanbul, immigration is much quicker and easier in Izmir than in Istanbul, and I avoid the bussing to claim my luggage when I arrive in Izmir.