Magnetic force attempts to align the two magnetic fields of the electromagnet and the permanent magnet, while at the same time a rotary spring resists the magnetic force.
(a rotary spring; resists; the magnetic force; T:the same time)
a rotary spring
resists
the magnetic force T:the same time