There are two clauses linked by the particle taw.
- mae'n rhaid - it must be
- llyfr Megan yw hwn - this is Megan's book
mai/taw is used to introduce the second clause because the second clause is an emphatic construction and so has to keep its verb yw in place.
Wait, so that’s three, actually...
So mai/taw is essentially ‘that’, if it introduces a clause?