Verse 3.27 described the deluded person. This verse describes the opposite: the tattvavit, the one who sees reality clearly. This person understands a liberating truth — the gunas are simply interacting with other gunas. The senses (which are products of prakriti) are engaging with sense objects (also products of prakriti). The soul stands apart from all of it.
Once you truly grasp this, attachment falls away on its own. It is like watching a play and knowing you are in the audience, not on stage. The drama continues, but you are no longer caught up in it. This understanding is the philosophical foundation on which the entire practice of detached action rests.