While most volcanoes / earthquakes occur along plate boundaries, there are exceptions. For example the volcanic Hawaiian islands which can be found in the middle of the Pacific Plate are formed due to a Hotspot. Hotspots are plumes of molten rock which rise underneath a plate causing localised melting and the creation of magma resulting in volcanic activity. See this animation for further explanation of hotspot activity.
The origins of the concept of hotspots lie in the work of J. Tuzo Wilson, who postulated in 1963 that the Hawaiian Islands result from the slow movement of a tectonic plate across a hot region beneath the surface.It was later postulated that hotspots are fed by narrow streams of hot mantle rising from the Earth’s core–mantle boundary in a structure called a mantle plume. Whether or not such mantle plumes exist is currently the subject of a major controversy in Earth science. Estimates for the number of hotspots postulated to be fed by mantle plumes has ranged from about 20 to several thousands, over the years, with most geologists considering a few tens to exist. Hawaii, Réunion, Yellowstone,Galápagos, and Iceland are some of the currently most active volcanic regions to which the hypothesis is applied.