When Israel was formed in 1947, it was given certain boundaries. While the Israelis had access to Jerusalem, it was supposed to be a shared area with the Palestinians. It was not supposed to be clearly part of one side or the other, as it is historically important to both Jews and Muslims.
In 1948, the Arabs and the Israelis engaged in a war which ended up with Israel claiming about 60% of the territory that the 1947 compromise gave to the Palestinians. Jordan and Egypt claimed the rest of the Palestinian territory.
In 1967, Israel engaged in war with three of its neighbors: Syria; Jordan; Egypt. At the end of the war, Israel had added four regions to its territory: the Golan Heights; the West Bank; the Gaza Strip; and the Sinai Peninsula. Israel later returned the Sinai to Egypt but has kept the other three. With the West Bank added, Jerusalem is clearly inside Israeli claimed territory.
Many Arabs in Palestine and elsewhere have rejected the very concept of Israel. From their perspective, Britain helped the Jews steal Israel from its Palestinian owners. (From Israel's perspective, it was their land first.)
Obviously if Israel is not valid, then Jerusalem is not part of Israel. But we can go further. If the original, 1947 plan was valid, then Jerusalem is still not part of Israel. That compromise made it no man's land that everyone could access but no one would own. Yet Israel now claims ownership of Jerusalem, and Donald Trump is proposing to recognize that ownership. From the Palestinian perspective, they are losing the small protections of the 1947 compromise. And they already regarded that compromise as unfair to them.
From the Israeli perspective, there's no point in them respecting the limits of the 1947 compromise if the Palestinians don't. So they want Jerusalem to be the capital of Israel as it once was. Moving the embassy is an important symbol in recognizing that.
Fundamentally opposed and conflicting perspectives leads to controversy.