Multiple SIgnal Classification: The music algorithm decomposes the spatial space into a signal and noise sub spaces. Thus given number of sources one can perform a one dimensional angle search to obtain the Direction of arrival (DOA).
For more information you can refer to these links
I believe there is enough comments in the code to understand it.