Tectonic plates lie below us, but they are always moving. When you are at the boundary of two of them, and they rub against each other in any way, then you can feel the vibrations. The intensity with which you feel the earthquake depends on the what type of plate it is and what movement the plates make near each other (but more on that later). If you place the nails of your thumb and index finger together in a straight line, and then place a little bit of Styrofoam or any such material on top, and then you move the nails and fingers in any direction, even slightly, the Styrofoam will move too, and this in a vague way shows what happens to cause earthquakes.