回 here is the measure word for 'event / occurrence,' as in 一回事 (yī huí shì 'one matter'). The phrase literally asks 'what kind of an occurrence is this?' Common variants: 是怎么回事 / 这是怎么回事 / 到底怎么回事.
usage
Tone matters: with rising surprise it asks for an explanation; with a flat resigned tone it can mean 'so that's how it is.' Negative form 不是那么回事 (bù shì nàme huí shì) = 'that's not how it is / not really.'