Drain in slab

There is hole in slab floor in closet that has cover and this drain is in slab. No apparent defects but was curious why they would have this and another cleanout outside.

appears to be a drain/waste cleanout
why in floor and not at grade or through wall is probably due to frost heave & freeze protection based on your location & really a ? for the installing plmbr

Appears to be a rough in for a future toilet drain.

How old is that house? I might be wrong but photo is not very good, it looks like the top of a drum trap.

It’s a drum trap

There is probably a tub in the next room