As others have said, it depends on what you're trying to do with each. I used to do all of my computing with a 2011 MacBook Pro, but found that the computer was plugged in and sitting on my desk 99% of the days of the year, so I later upgraded to an iMac. I have a work iPad and a home use iPad, and more recently bought a MacBook for work and travel. I can tell you how I use my iPads, which may help you to get a feel for what use cases there are.
At work (hospital/clinic):
iPad (standard size, no keyboard case but an Otterbox Defender-like full case, use with Apple Pencil and other styluses) acts as a paper replacement. I take notes, reference notes, reference books, reference websites, read emails and give basic replies, text message with team members, and use "scanner" apps to digitize papers for further markup or reference. It is always with me, and fits into my white coat pocket.
Despite being incredibly thin and light, the MacBook requires that I carry a small messenger bag with me, so I don't always bring it. When I do, it is almost always for tasks that are more keyboard-heavy. I have tried the iPad with its keyboard case but found that I prefer the MacBook, not because of the feel of the keyboard but because I like having a mouse and being able to multitask a bit more easily.
What it boils down to is that the iPad is fantastic for handwriting, fast access, and reading. A full Mac system is still superior when it comes to other forms of work.
At home:
I use the iPad for basic web browsing, reading (books or articles - again, marking them up with aid of the Pencil), online shopping (Amazon/eBay), video chatting with family, and texting. It's more comfortable and convenient to be able to go anywhere in the apartment and be on any piece of furniture. While the MacBook is the thinnest and lightest of the Mac systems, the iPad is still more mobile. It feels faster to get into and out of, as well - and I say that despite owning an Apple Watch, and using the "watch unlock" feature with my Macs.
The iMac (or MacBook) can be used for all of the above, but it gets used for heavier media activities and type-heavy activities (particularly since I have a mechanical keyboard, which blows away the MacBook's keyboard).
When traveling far away from home:
I generally bring both, but end up using the MacBook more. If I could choose only one device, it'd be the MacBook.
Looking back, it has now been about five years since my first iPad was given to me as a gift. I couldn't think of any uses for iPads before that gift, and immediately after receiving it, I couldn't think of any uses then, either. It has now become my most-used device, actively receiving use during many hours at work and probably receiving the most screen time at home. Maybe I could have used my MacBook Pro (and now, my MacBook) in the same manner, but they just don't feel anywhere near as portable or convenient by comparison.