How do black holes create gravity?
They have what we call "mass", which is a measurable property of systems. An attractive force between objects which have measurable mass exists which is also measurable, we call it "gravity". Newton managed to come up with his theory of gravitation, including the mathematical models necessary to make predictions. Newton's gravitational models are pretty useful until one starts to go really fast (so-called relativistic speeds).
Gravity and classical mechanics result in orbital mechanics - the mechanics of orbiting bodies under gravitation. Black holes and the matter surrounding them exhibit phenomena which are consistent with orbital mechanics and from this their gravity and mass is inferred from observation of their effects on their surroundings.
Other observations of black holes, such as spectroscopy of the "light" given off by the rapidly rotating matter around a black hole also allow to validly infer what is going on.
As for how gravity is "generated" as a mechanism, no one yet knows.