Scientists think that the smaller black holes were made when the universe started - and stellar black holes would be made when the middle of the bigger stars collapses in on itself. So, when this occurs, this is what creates a supernova - this is an explosive star that sends some of the star right into space.
In fact, scientists actually think that supermassive black holes were formed at the same time as the very galaxy that they reside in.