what doest "hit or miss" in morphology do?
The Hit-or-Miss transform as the name suggest uses 2 structuring elements (SE) to identify structures which are specific to the foreground (first SE) and background (second SE).

Here, you have a good example for corner detection. The only difference is that the two SE are merged into 1: The 1 are part of the foreground SE in order to determine a specific shape in the pattern, and the 0 are part of the background SE. Consequently, the algorithm hits only if all the conditions on the 1 and 0 are respected, else it's a miss.

This principle is mainly used for skeleton computation, but it can be derived to build all the mathematical morphology basic operations.

Here are more explanations:
 - A complete video of a class.
 - Much more examples in this complete lesson.
 - StackOverflow