There are hundreds of species of Solitary Bees around the world. They're called solitary bees because they don't build communal nests. What they do instead is lay their eggs in small cells that they build in walls, tubes, sandy banks, or in boreholes in dead wood. Most of them don't have stings, so there's very little chance of being stung by them.
Each species has very specific needs. Normally you will only see the adults flying around your garden for a month or so as most of the year is spent as larvae, growing inside the cells that were made the previous year by the adult bees. The larvae feed on the store of pollen that was placed in each cell by the mother bee.
Bee Hotels provide an array of suitable nesting places for these bees. They are often also popular with other insects such as Ladybirds and Lacewings. These bees are great pollinators, so they are well worth encouraging in your garden.