Apps are examined by USPTO personnel called Examiners, who work in different technology groups called art units. Depending on the backlog of a particular art unit, an app might not get picked up by an Examiner for a couple years after it's filed.
The first thing an Examiner does with a new app, once it reaches the top of his pile, is conduct his own search in the USPTO databases, which brings up, among other references, issued patents and published applications, all of which is collectively referred to as prior art.
After the Examiner determines whether the claims in the app (i.e., the invention) are anticipated by, or are obvious in light of, the prior art, he explains his reasoning in a communication to the patent applicant. If claims are rejected (and they almost always are), the Examiner has to cite the references over which the claims are rejected.
Occasionally things go amiss. Examiners are human; they make mistakes. And when they do, they're funny.
In this recent communication, the prior art cited to reject the claims is the publication of the app being examined.
I'm not sure which is worse: that the Examiner cited the application against itself, or that he considers some of the claims to only be obvious in light of it.