In this chapter, Moses reiterates that the Levites and priests have no inheritance in the land and commands the Israelites to follow the prophet of God rather than witchcraft.
The first section, reiterating the inheritance structure of the Levites and priests, is a point that has been brought up on many occasions. Earlier references include Num 18 and passing references within Deuteronomy such as Deut 10:9, 12:12, 14:27 and 14:29. This is the only section of Deuteronomy that expands on the inheritance of the Levites, and it is consistent with prior references.
Numbers 18 discusses the inheritance of the priests and the Levites and this chapter does the same, though with uncharacteristic brevity. The language between Num 18 and here is also very similar, with Num 18:20 expressing, "You shall have no inheritance in their land... I am your portion and your inheritance among the sons of Israel". This chapter says, "They shall have no inheritance among their countrymen; the LORD is their inheritance, as he promised them." (v. 2)
In this chapter, it begins, "The Levitical priests, the whole tribe of Levi..." (v. 1) Note how this merges together the priests (sons of Aaron) and the Levites (the whole tribe) as if they were the same thing. They are not, but I have stated before that the Levites are like quasi-priests, holding some of the roles and responsibilities of the priesthood but not the whole thing. Also, the priests are part of the tribe of Levi. Num 18 addressed both the priests and the Levites, and this chapter does similarly first mentioning the "priests' due from the people" (v. 3-5) and second the Levite's portion (v. 6-8).
All of this we have seen before, so I think the second section is more interesting. It begins by forbidding the many types of Spiritism practiced by "those nations" of Canaan. There's many different words for witchcraft here and they are all describing similar things. Looking at the Hebrew, I think we can get a clearer idea of what witchcraft really meant to the author and how it was practiced at the time.
You shall not pass your son or daughter through the flame. This is straightforward; it prohibits child sacrifice, a subject of frequent criticism in the OT (Lev 18:21, Lev 20:2, Deut 12:31; many later references as well).
You shall not "qasam qesem", which approximately means to cast a lot or to divine through some oracle. This is the sort of language that was used to describe Balaam when he was hired with payment for a "qesem" by Balak (Num 22:7). On the other hand, we are told that the Israelites cast lots to determine the "goat of Azazel" (Lev 16:8). In Lev 16:8, the words for casting a lot are "nathan goral", which indicates that this is a different procedure than the idolatrous witchcraft of the Canaanites. The precise difference is hard to determine, but what's clear is that some kinds of divination are permitted, so long as they operate through the covenant and are focused on the LORD.
In fact, prophecy itself could be regarded as a sort of permitted divination, as the prophet reveals the will of the LORD and sometimes future events (for instance, Gen 49 prophecy regarding the future of Israel). Secondly, we know that the Urim and Thummim were occasionally used for divination (Num 27:21, 1 Sam 28:6) and this was also permitted by the LORD because the Urim and Thummim were tokens of priestly authority and part of the covenantal agreement. Both prophecy and the Urim are permitted because they are means of seeking the will of the LORD, and as long as they are pursued for that reason they are lawful.
You shall not "anan", meaning to "cloud over" or "act covertly". This term emphasizes the secrecy of magical practice, and is translated by the NASB as "one who interprets omens".
You shall not "nachash" or "kashaph", meaning to hiss and whisper. Both terms refer to whispering or invoking magic spells.
You shall not "chabar cheber", which literally means to "join a company" but in this context refers to enjoining a magic charm.
Lastly, you shall not inquire of spirits, be a "knowing one" (probably referring to forbidden magic and conjuration), or "tread amongst the dead"
I quoted the Hebrew for some of these terms because I enjoy the alliteration. I also enjoy the imagery that we see when looking at literal translations, since it shapes a picture of people who "covertly whisper and hiss, enjoining magic spells and charms, consulting and seeking the dead and divining the future through lot or animal entrails, knowing forbidden magic". These words create a picture of what divination was like and what Moses was prohibiting.
The last part of this chapter, after describing all the many forms of prohibited witchcraft, is to tell the Israelites how they may seek guidance through the prophet whom "the LORD your God will raise up for you".
I have talked about prophecy in general on several occasions (Gen 18, Deut 13), and I am reluctant to do so here, so instead I will simply talk about what is new in this passage. This chapter is interesting for a couple reasons. First, it is predictive of a future "prophet" who will be raised up. Second, it refers to raising up a prophet in the fashion of Moses. I had already called Moses a type of Christ, so my first thought on reading this passage is that "the prophet" is a reference to the future Christ, and later on the NT quotes this passage to the same effect (Acts 3:22 and 7:37 in particular).
Third and lastly, this passage quotes from Ex 20:18-21 but everything about raising up a new prophet in the fashion of Moses is new. If you cross-reference these two passages, you will see that Moses and the LORD are pleased by the people's response in both cases, but only in Deuteronomy does it talk about raising up a new prophet to intermediate between the people and God. In the case of Exodus, it is clear that Moses is the person who will speak to the people on behalf of God.
I have heard some people use this passage as evidence that modern-day, NT prophecy is not valid, based on the presumption that modern-day prophets will always get at least one prophecy wrong, in which case they have "spoken a word presumptuously" and that they should be put to death or something like that. I cannot address this topic here because it requires a lot more context from later in the OT and the NT before I can give a proper analysis of modern-day prophecy.
There are two things I would like to say, as it relates to prophecy. First, keep in mind the theme of progressive revelation as we read through the bible, in this case as it relates to prophecy. Look at the ways that prophecy-as-a-concept changes as we move deeper into the bible, and this is especially true when we come to the NT.
Second, lets briefly review what we already know about prophets. Prophets speak on behalf of their gods (Ex 7:1). That means that as a prophet, you are a representative or ambassador for your god. We see Moses act in this fashion many times as he mediates between the LORD and the people of Israel to establish the covenant. Ex 19:7-9 shows Moses taking the words of the LORD to the people, and then taking the people's answer back to the LORD. Moses also acts as a representative of the LORD's interests to the people, teaching them how to follow the covenant and the LORD. In turn, Moses also acts as an intercessor before the LORD on behalf of the people (many times, but most notably in Ex 32:11-14).
These two dimensions are the dual mandate of a prophet: interceding for other people before the LORD, and then taking messages from the LORD and giving those messages to other people. Sometimes the messages involve predicting the future, but in many cases they do not. The covenant was a prophetic message from the LORD to the nation of Israel, but it involved only minimal predictions of the future. Most of the bulk of the covenant concerns moral and religious laws that they are to follow, as we have read in considerable detail in the preceding chapters.
Abraham was a prophet (Gen 20:7). In what way did Abraham act as a prophet? Abraham did exactly the things I just wrote about, which we see in Gen 18 when Abraham intercedes on behalf of "the righteous" (really just his cousin Lot, but he generalizes and says "the righteous") and as a result God spares Lot and his family. We never see Abraham give any specific messages from the LORD to other people, but it's hard to deny that Abraham was "inspired" (which is what the Hebrew word "nabiy", prophet, is derived from).
In light of the dual mandates of the prophet, it is surprising that the test of a prophet is "if the thing does not come about or come true" which suggests future-predictive statements that allow for concrete validation. Probably the best way to look at this is the miracles that Moses performed early in his ministry. In Ex 4 Moses is given a set of miracles that he could perform to convince the Israelites, and then later Moses performed a set of miracles to convince (and eventually intimidate and punish) the Egyptians into letting the people go (Ex 7-12). After that, Moses still performed a few miracles (crossing the Red Sea, water out of rocks, etc), but his credentials as a prophet were largely established.
I want to reiterate that prophecy can and does have future-predictive elements, just that it doesn't need to have future-predictive capacity to be prophecy, nor is future-predictive prophecy the entirety of the prophetic ministry. Half of the job of a prophet is talking to God, not to men, and doesn't involve predicting anything to anyone.
One last story I should mention is when the seventy elders of Israel prophesied in Num 11:24-30. In this case, prophecy is directly linked to the resting presence of the Spirit of God, which is why it is called "inspiration". It is not something done separately from God, but only through the guidance of the Spirit. In the case of the elders, we see that they did not give any recorded predictions at all, but simply "prophesied" (Hebrew, "naba", to speak or sing by inspiration; prophesy). This is a very different modus operandi compared to Moses, who is generally giving specific instructions, prophecies or laws at the behest of the LORD.
These two modes continue well into Israel's future, with later prophets in the line of Moses (such as Isaiah) and companies of prophets who are known to "naba" without giving any specified prophetic guidance. I think a bifurcation of these two classes is supported by the text based on the behavioral and thematic differences. I will expand on this further when we reach the great prophetic era of Israel.
In conclusion, Deut 18 is not the definition of a prophet, it is the test of a prophet, and it is a test that we must always hold in parallel to the Deut 13 test, that true prophets will only ever give prophetic messages that lead us to the LORD alone. A prophet who gives a true sign but teaches apostasy is a false prophet.
The NT, in its turn, expands the scope of the prophetic ministry in considerable ways, but I cannot address that here. As with so many other topics, I must defer until we have read the NT itself.