A Miranda warning is designed to be a protection against self incrimination, that is, a protection from defendants being forced to make statements or give other information that will help the government convict them of a crime. The Miranda case says that where a person is in custody and being interrogated (asked questions) those circumstances are similar to a forced confession. For that reason, the police must first warn a person who is in custody and being questioned that they have the right to remain silent, that what they do say will be used against them in court, and that they have the right to a lawyer. Unless the warning is given, the statements made by the defendant cannot be used in court.
Why did I receive a Miranda warning? Simply, because the police hope that you will make statements they can use to convict you. It is never just to “get your side of things,” it is always to build a case against you. At the end of the warning, you may be asked if you understand you rights and are willing to waive them. The answer should be “no” 100% of the time until you can talk to a lawyer. Any statement you make, even if you declare your innocence, can be twisted and used against you.
But what if you were arrested and never received a Miranda warning? Does that mean the charges will be dropped? Not necessarily. First, any statements that are volunteered to the police don’t require a Miranda warning. In other words, if you tell them things without being asked a question, Miranda doesn’t apply because you aren’t being “interrogated.” This is true even if you have already said you are remaining silent and have asked for a lawyer.