The Soil Moisture Sensor Module (Capacitive) acts like a capacitor where the water level changes the capacity and we can measure that charge and discharge timing. It is a popular module for measuring the moistness of soil. The biggest advantage over a traditional moisture sensor is that the capacitive sensor doesn't corrode.
The sensor module comes with a 3-pin jumper wire for easy interfacing with Arduino.
Resources: