Topology

For a smooth map between compact connected oriented manifolds of equal dimension, why can the signed preimage count at a regular value be used as a global invariant?