The main factor will be the pickups. Standard Strats have single coil, while SGs have humbuckers. There's also the placement of pups - 3 on the Strat, two on the SG.
The strings will probably be different gauges, as the scale lengths are different, so that will add to different sounds.
The SG has a through-neck, compared wth a bolt-on for Strats, and some say that the wood - or more importantly its density - for both body and neck - are contributing factors. As are the differences between vibrato on Strat compared to none on SG - where the strings go straight over the bridge and into the part holding the bullets - although I'm sceptical those factors make much difference, as the strings don't vibrate on that side of the bridge, in either case.
All that, and subtle differences in the circuitry used, add up to a marked difference in sound.