Liquid damage is insidious and pervasive. When liquid gets into an electronic device, it may cause an immediate short circuit that damages the device. Even if that does not occur, a few days after the liquid evaporates corrosion will begin to form and will spread over the coming weeks. At some point a critical component will fail and the device will stop working entirely. If your Mac is still functional and you aren’t regularly backing it up, now is the time to start (perhaps with Apple’s Time Machine that’s already on your Mac).
Apple incorporates several moisture sensors into their products to reveal liquid ingress. Liquid damage is not covered by the warranty, though it is covered by AppleCare+ plans (which must be purchased/subscribed to separately).
Note that repair prices for such damage are often very high because multiple components typically need to be replaced. Unfortunately, it is often more cost-effective to purchase a new Mac.
The latest Mac notebooks (many M3 models and all M4 models) can detect and warn when there is water in the Thunderbolt/USB-C port. That warning can occur with only a small amount (e.g. a drop) of liquid in just the port, but also if a larger amount of liquid is both in the port and inside the Mac, and there's no way to distinguish those two.