You have to totally erase the iPad that you want to give to the grandkids using these directions.
What to do before you sell, give away, or trade in your iPhone, iPad, or iPod touch - Apple Support
After that iPad has been erased, you would need to set up one Apple ID for one of the kids. You can only use one Apple ID per device and ideally nobody should share an Apple ID with someone else. However, if you only have one device for both kids to share, this is the only way that what you want to do will work.
I am assuming that the kids are under 13, so see this for creating their Apple ID
Create an Apple ID for your child - Apple Support
After the child has an Apple ID, you can set up Family Sharing which would allow you to set up Screen Time on the kid’s iPad as that can monitor what they do an purchase.
Take a look at this.
Set up Family Sharing - Apple Support
This will help with setting up screen time and parental controls.
Use parental controls on your child's iPhone, iPad, and iPod touch - Apple Support
Make sure that you read all of the links carefully and that you understand what to do before you get started.