In a brushless motor, you lose the commutator and brushes while gaining an electronic controller. Now the permanent magnets act as the rotor and rotate around on the inside while the stator is made up of the fixed electromagnetic coils now on the outside. The controller powers each coil according to what charge it needs to attract the permanent magnet.