Electricity was not invented; it has always existed. Many, many people worked to identify it and then to develop uses for it.
Magnetism relates to electricity because they both have to do with moving charge.
Also if you have a magnet you can produce a current through induction and if you have a current, there is a magnetic field surrounding the current. So magnetism and electricity are somewhat intertwined.
A fixed pulley makes the wok easier by changing the direction of the force, and the distance the force is applied over.
In a power station the large generators have magnets inside them which are turned by a shaft inside a coil. The magnet that spins inside the coil is itself, another coil of wire with DC current flowing through it, thus turning it into an electromagnet. (They do not use permanent magnets).
The DC current in the spinning electromagnet, is called the 'excitation' current. It is produced separately via a control circuit, the voltage and power produced by the generator can be controlled by varying the excitation current. This is mostly done automatically these days.