If it rains before the product has become rainproof (this varies by product), the product may not be as effective (source). The rain washes away the weed killer from the lawn, and it can’t do its job as well.
The weed killer must be absorbed properly to take effect, so it’s essential to use the product on a day when it won’t rain.