WASHINGTON — The Heritage Foundation, a powerful conservative think tank that played a significant role in shaping President Trump’s cabinet and tilting it far to the right, is expected to replace its leader, the former South Carolina senator and Tea Party leader Jim DeMint.

The anticipated shake-up, which was confirmed by two people with knowledge of the fraught internal dynamics, comes at an inopportune time for the group, with several major pieces of conservative legislation on the agenda in Congress. The budget, a tax overhaul and health care are all issues that Heritage has tried to influence, with varying degrees of success.

A spokesman for the foundation did not return a request for comment.

Mr. DeMint’s abrupt ouster, described by people as a “coup” against him, was the result of a larger debate among conservative donors who fund the group. One of its board members is Rebekah Mercer, a reclusive donor who has helped propel the White House chief strategist, Stephen K. Bannon, in his effort to dismantle aspects of the political establishment.

Ms. Mercer was described by people with knowledge of the events as helping drive the effort toward a shake-up. Another person close to the discussions, who asked not to be identified, said that Mr. DeMint was not seen as sufficiently pro-Trump by some members of the board.