Both are a landscaped depression with a berm and an outlet structure. Both slow down peak stormwater flow. But one is supposed to be empty most of the time, and the other is supposed to never be empty at all — and that single difference decides whether the pond is doing anything for water quality.
A detention basin exists to temporarily hold stormwater runoff and release it slowly, through a controlled outlet — an orifice, a weir, or a restricted pipe — so the peak discharge rate reaching a downstream channel or storm drain is lower than it would be without the basin. It is normally dry between storms, or holds only a small permanent low-flow pool at most. A retention basin (commonly called a wet pond) does the same peak-flow attenuation, but it also maintains a permanent pool of standing water at all times — even in the middle of a dry summer with no storm in sight. That permanent pool is not incidental. It is the entire reason a retention basin can do something a detention basin structurally cannot: treat water quality.