Not always end of story. Some defendants believe that if they can show that a search was illegal, the case must be dismissed. Not true. If a prosecutor has enough other evidence to prove the defendant guilty, the case can continue. Also, the illegally-seized evidence can generally be considered by a judge when deciding on an appropriate sentence following conviction and admitted in civil and deportation cases. In some circumstances, a prosecutor can use such evidence to impeach (attack the credibility of) a defendant who testifies at trial.
The police can conduct searches where necessary to ensure their safety and the safety of the public. Objects that are in plain view such as a bag of drugs in the backseat of a car do not require a warrant or probable cause to be seized and admitted as evidence. In an emergency the police may conduct a search; an example would be while in pursuit of an armed fugitive. Searches of an individual and the surrounding area are permitted when an arrest is conducted. Finally, if consent is given no warrant or probable cause is necessary to conduct a search.