For the LORD will not forsake his people for his great name’s sake: because it hath pleased the LORD to make you his people.
Israel had sinned in asking for a king. In doing so they had rejected God's rule over them. The Lord will not forsake or abandon His people for His great name's sake, because it pleased Him to make them His people. He is merciful and forgiving and desires to show them favor when they obey Him. Even after that sin His mercy remains available, so the people can still turn back to Him and follow Him. Therefore they should not despair or turn away from serving Him. They are called to fear Him and to follow and serve Him wholeheartedly. They must not go after worthless pursuits that cannot help them. This assurance does not excuse wrongdoing or permit continued sin, for continued and persistent wickedness will bring judgment.
The verse belongs to Samuel's closing appeal after he had protested Israel's setting aside of the old order to choose a king the people insisted on having. In that setting it promises that the Lord will not forsake or abandon Israel, showing the certainty of His watch-care over His people. That faithfulness and guidance continued despite their sin in asking for a king and despite their other failures. His continued care rests on His own great name and on His choice and pleasure in making them His people. For that reason the people are urged to cleave to Him and fear Him only. They are urged to remain faithful and to be assured of His guidance. They must turn back to Him, follow and serve Him wholeheartedly, and not pursue useless things. His mercy remains available even after their sin. Yet the assurance of His faithfulness is not permission to continue doing wrong, for persistent wickedness brings judgment.