Štih was born in Ljubljana, but spent most of his childhood years in the town of Most na Soči in the Goriška region of western Slovenia. He attended grammar school in Tolmin and studied history at the University of Ljubljana, where he graduated in 1983. In 1993 he obtained his PhD under the supervision of the historian Bogo Grafenauer. Between 1992 and 1994 he was assistant researcher at the Institute for Austrian History (Institut für Österreichische Geschichtsforschung), part of the University of Vienna.
Štih teaches medieval history of the Slovene Lands and the Balkans at the University of Ljubljana. He also teaches at the University of Maribor. An associate member of the Slovenian Academy of Sciences and Arts since 2007, he became a full member in 2015. He is also a member of the Austrian Academy of Sciences.
He is the author of several publications on the medieval history of Slovenia. His principal research fields include the ethnogenesis of Slovenes following the Slavic settlement of the Eastern Alps, early medieval state forms in the Eastern Alps (Carantania, Carniola), the history of nobility, and the emergence of Slovene Lands. He has also published a number of treatises on diplomatics. As of 2000 he is the main editor of Zgodovinski časopis / Historical Review, a principal Slovenian historic periodical.
- Ozemlje Slovenije v zgodnjem srednjem veku: osnovne poteze zgodovinskega razvoja od začetka 6. stoletja do konca 9. stoletja ("The territory of Slovenia during early Middle Ages: a basic outline of historical development from early 6th century to late 9th century", Ljubljana, 2001);
- Slovenska zgodovina do razsvetljenstva ("Slovene History prior to the Enlightenment Age". Ljubljana - Klagenfurt: 1995), with Vasko Simoniti;
- Carniola, patria Sclavorum (Vienna: 1995);
- Studien zur Geschichte der Grafen von Görz ("Studies in the History of the Counts of Gorizia". Vienna - Munich: 1996);
- Spomini Helene Kottanner: ženski glas iz srednjega veka ("Memoires of Helena Kottanner: a Woman's Voice from the Middle Ages". Ljubljana: 1999), with Igor Grdina;
- Srednjeveške plemiške zgodbe ("Stories from Medieval Nobility". Ljubljana: 2001);
- Slowenische Geschichte: Gesellschaft - Politik - Kultur ("Slovene History: Society - Politics - Culture". Graz, 2008), with Vasko Simoniti and Peter Vodopivec.
- The Middle Ages between the Eastern Alps and the Northern Adriatic : Select Papers on Slovene Historiography and Medieval History. Brill, 2010. ISBN 978-90-04-18591-3
- "Novi člani Slovenske akademije znanosti in umetnosti" [The New Members of the Slovenian Academy of Sciences and Arts]. Sazu.si. June 2015.
- "Archived copy". Archived from the original on 2008-10-19. Retrieved 2009-04-07.CS1 maint: archived copy as title (link)
- ""V izjavah šolskega ministra je zaznati željo po poudarjanju bolj narodno afirmativnih tem, pri čemer se je prav pri njegovem zavzemanju, da bi v ta kontekst sodila tudi t. i. karantanska prisega, pokazalo, kako je lahko takšno zavzemanje s strokovnega stališča povsem nesprejemljivo."". Mladina.si. Retrieved 11 August 2017.