Seismic activity in Switzerland and the formation of the Alps are closely interlinked and can be attributed to the same underground processes. As a first approximation, the earthquakes observed in Switzerland result from collisions between the European and African lithospheric plates, reflecting the mechanics behind these processes.
Human activity like tunnel construction, filling reservoirs and implementing geothermal or fracking projects can trigger earthquakes, too (see the question "What are induced earthquakes?").
Detailed explanation of the causes of earthquakes in Switzerland
Tectonic plate collision in the Alps