The basic atomic structure of a magnet seems to align most of the molecules in the same direction. It's possible to see this force through a simple experiment:
Put a bar magnet under a sheet of glass and sprinkle iron filings on the glass. The lines of force from the magnet show up clearly as the filings form a pattern. Notice that the attractive forces are greatest at the two ends of the magnet, where the majority of filings gather. We call these ends "poles".
The density of the pattern represents the strength of the field, which is the magnitude of the force exerted upon a magnetic material placed at the point in the field. These lines are called lines of magnetic flux.
If we suspend a magnet by a string from its center so that it is free to turn, it will turn until there axis lines up with its poles, lying along the earth's magnetic north and south poles. The pole which points north is called the north pole and the other is called the south pole. These are usually designated by an N and S marked on the magnets.
The like poles will repel one another, while the unlike poles will attract one another. This is a very important principle since the generation of electric power depends on these laws of attraction.
Almost all commercially available magnets are artificial. They were manufactured to be magnets by using other magnets to create the correct molecular alignment.
There are two types of magnets: temporary and permanent. Temporary magnets are those which will hold their magnetism only as long as the magnetizing force is maintained. These are usually found inside motors.
Permanent magnets are those which will hold their magnetism after the magnetizing force has been removed and will continue to be magnets for as long as they are not disturbed by being jarred or heated.