Why are most of the earthquakes and volcanoes located at the border of the tectonic plates?

The plates rub together