Stepper.h library on Arduino

Does anyone know how the stepper.h library actually works? I do not quite understand how the pins are being driven in their 4-step sequence for the bipolar stepper motor (4-wires control). What is MyStepper.step( )?

Documentation:

If you need more detail you can always read the sources.

Where can i find steppre.h source?
I'm able to control H-brige driver like L298N (4 wires). But for step dir (2 wires) i don't know how. I want to drive my stepper motor with L297.

libraries/Stepper/Stepper.cpp
libraries/Stepper/Stepper.h

inside the distribution (depends on OS, and where you choose to install it...)

This is where the presupplied libraries live (as opposed to ones you install
yourself under sketchbook/libraries/)

The core runtime stuff is in
hardware/arduino/core/arduino/