Multimodal and controllable motions in complex terrain are of great importance for practical applications of insect-scale robots. Robust locomotion plays a particularly critical role. In this study, we reveal and define a locomotion mechanism for magnetic robots based on asymmetrical friction effect induced by magnetic torque. The defined mechanism overcomes the design constraints imposed by both robot and substrate structures, enabling the realization of multimodal locomotion on complex terrains. Drawing inspiration from human walking and running locomotion, we propose a biped robot based on the mechanism that not only exhibits rapid motions across substrates with varying friction coefficients but also achieves precise motions along patterned trajectories through programmed control. Furthermore, apart from its exceptional locomotive capabilities, the biped robot demonstrates remarkable robustness in terms of load-carrying and weight-bearing performance. The presented motion and mechanism herein introduce a novel concept for designing magnetic robots while offering extensive possibilities for practical applications in insect-scale robotics.