The 5’ cap protests the newly-synthesized mRNA from degradation. It also assists in ribosome binding to help initiating translation.
3’ poly-A tail protects mRNA from degradation, aids in exporting the mature mRNA to the cytoplasm, and is also involved in binding proteins to initiate translation.