The end of Hannah's song of exaltation flows into prophecy. “The Lord will judge the ends of the earth,” Hannah announces, “He will give strength to His king, and exalt the power of His anointed.”
She probably didn't even understand completely what she was saying, for the Holy Spirit was using her as His instrument, speaking through her to send a message to people of all times and places.
Indeed, the Lord has judged, is judging, and will judge the ends of the earth. All things lie in His hands. He sees and knows and understands all and can therefore judge perfectly. He will do so ultimately at the end of time when all things will be made manifest and we shall understand His judgments fully.
When Hannah lifted up her prayer, Israel as yet had no king. The one who would someday appoint that king was her own son who was still a small child. Nonetheless, Hannah speaks confidently that Israel would have a king, and when it did, he would draw his strength from God Himself. Hannah's words would be fulfilled first in David and later, perfectly, in Jesus.
The final phrase of Hannah's prophecy would also find fulfillment in David and especially Jesus. God would raise up the power of His anointed. David was anointed as king by Samuel and given power to reign as king over Israel. Jesus, too, was anointed, only by the Holy Spirit directly at His Baptism, and of course, He was and is the most powerful of kings, for He is God incarnate.
Hannah could not have known any of this, yet she spoke with confidence. God would do exactly as He promised; Hannah was certain of that, and she would always praise Him for it.
(1 Samuel 2:10 – NSRV-CE)