Hi @DishaSharma,
If a primary key field is left blank in the input form, then you would get an error in the form automatically.
The "leave" tag is used to apply extra validations, such as mandatory fields, or closed value fields, or to make SOAP calls internally fetch update values in other tables, or to do some other logic, etc.
There are plenty uses which the leave tag can be put to.
BR,
Ishan