Motive is the term used to explain why a person committed a crime. It isn't the same as intent, which relates to whether an action was accidental or intentional.
Intent is an element of just about every crime, meaning that the prosecution must establish that the defendant intended to commit the criminal act. (Sometimes it's enough to prove that the defendant didn't act intentionally, but was reckless or criminally negligent.) But motive usually isn't a criminal element—the prosecution doesn't have to prove the defendant had it. Instead, prosecutors try to establish motive in order to convince the jury that the defendant is guilty.
Example: John and Sue have been happily married for 30 years. John is diagnosed with a terminal illness and is in constant pain. After living in agony for several months, he repeatedly asks Sue to kill him. After much deliberation, Sue shoots and kills John. Sue's intent was to kill. Her motive was to stop her husband's pain. She's guilty of murder even though her motive may have been compassionate.
Example: Rob is on trial for theft by larceny. (See Theft & Robbery Laws.) The prosecution has to prove that he took someone else's property while intending to permanently deprive the owner of it. Rob claims that he took Joe's wallet so he could have it cleaned—then he was going to return it. In order to show that Rob intended to keep the wallet for his own purposes, the prosecution offers evidence that Rob has a drug habit that he's had trouble financing.