The search of a phone is like a search of any other thing in US law. Generally, searches require a warrant which implicitly requires probable cause, but there are some well-defined exceptions to the warrant requirement, and the probable cause requirement. One of these exceptions is the border search exception. US Courts have previously said this exception is reasonable for various reasons, and is an exception to both the warrant and probable cause requirements. The court in this case says it is an exception only for
routine
searches, and called the digital searches
non-routine
which don't fall entirely within the existing exception. Rather the court says non-routine searches don't require a warrant but do require a reasonable suspicion, a standard still below probable cause. A reasonable suspicion requires only the officer to have a suspicion they can state a reason for. For example, a phone's lock screen with CP would satisfy reasonable suspicion.
> Would the suspicion have to be announced to me, when I’m asked to unlock my phone[?]
No. Officers don't have to disclose to you their reasons. It's helpful, but not constitutionally required.
>[W]ould it have to be presented to a court, when they are asked to prosecute me based on the contents of my phone?
Not necessarily. In a criminal prosecution violations of the Fourth Amendment can be excluded by the court. The theory underlying the exclusion is that without the exclusion there would be nothing to stop cops from violating your Fourth Amendment rights. A criminal defendant must challenge the use of the evidence found, and the officer must give their reason when the judge is trying to determine whether to allow the testimony.
In the US, you can also sue the officers when they violate your rights and win money damages. That's what this case is. The officer as part of their defense must give their reasons to defend they didn't violate any constitutional rights.
>If they find illegal content on my phone, wouldn’t the prosecutor just tell the court “she matched a profile for the sort of person that carries illegal documents”?
Probably. Some courts may additionally require the officer to give a basis of why you fit that profile, or why someone who fits that profile reasonably is likely to carry illegal things. Typically just saying it matches a profile is sufficient.