There was a theory behind why SSRIs work that existed when they were developed (the serotonin theory of depression), but this theory was later shown to be wrong - basically, SSRIs do modulate serotonin but that has no relation to whether you are depressed; if SSRIs do work, its through another mechanism. In addition the efficacy is greatly overstated; large follow-up studies have shown that they only have measurable effects on the most severely depressed individuals. The vast majority of people being prescribed SSRIs do not fall in this category and likely receive no benefit beyond placebo.