M51 is good for those who love to play games and heavy task good combination of bigger battery and processor(730G) but this is not for those who love features like secure folder, edge lighting, Samsung pay, and good lock so if you want to use full one ui features then you should go with A51.
update and future is important than buy A51, camera pictures quality is not so different whether take by 64mp or 48pm. i personally found it with m31 and a51. software support is better than M series that all know. also A51 look premium at lower cost. so many functions are better in A51. if my personal opinion matters than buy any A series.