You need to two essential steps for making edibles: Decarboxylation and Infusion.
Decarboxylation is necessary because it activates the THC. If you just put weed flower in baking it will be mostly inactive and not do much.
THC is fat soluble so after it's been activated you're just encapsulating the THC in the fat of the butter or coconut oil. From there, its just a matter of making the various edibles with the butter.