I've had so many couples look at me in confusion when I mention the wedding rehearsal. Your wedding rehearsal is separate from your rehearsal dinner and here I will lay out exactly what it is.
The wedding rehearsal is literally a rehearsal of the wedding day. Think of it in the same sense as theatre kids doing a rehearsal before the night of their play. If you have a wedding planner or coordinator, they will run the entire rehearsal, otherwise your venue manager may step up to manage it but not always so definitely double check with your venue (or just hire a planner!).
During the rehearsal, you will run through every major aspect of the wedding. You will do a final tour of the venue, pointing out getting ready rooms, photo locations, ceremony, cocktail hour, and reception areas, etc. You will also run through your ceremony step-by-step: where to stand, timing your walk, how to hold your hands, processional order, etc. You will also run through the reception but likely not in as great detail as the ceremony. This includes wedding party entrances, couple grand entrance, toast order, etc. The entire wedding rehearsal will take about 1.5-2 hours but can easily go longer if you have a rowdy wedding party and it's difficult for the planner to keep their attention and continuously has to repeat themselves or run through certain activities multiple times.
The rehearsal not only relieves a lot of stress and anxiety for the couple but also ensure your wedding party knows what to do, when to do it, and where to do it. At the end of the rehearsal, everyone should be on the same page, all questions should be answered, and everything should run much more smoothly the day of.
The rehearsal is not just for the couple. Your entire wedding party needs to attend. Anyone who is participating in the ceremony/processional, reception entrances, or toasts needs to be at the rehearsal. This is usually bridesmaids, groomsmen, ring bearer, flower girl, and immediate family but of course may include others. Your officiant is also an important person to ask to attend the rehearsal. You want to make sure you let these people know about the rehearsal date and time far enough in advance to ensure everyone's attendance.
The wedding rehearsal is not the event to invite all your friends and family to. It should literally just be the people previously listed. Obviously the ring bearer and flower girl will likely have to come with their parents or a groomsman may be getting a ride from their girlfriend. That's completely fine, those extra people don't necessarily have to leave but they do need to stay out of the way (no offense :)). Too many people causes too much overlapping conversation and results in having to repeat the same information or run through the same activity multiple times. It can also be very confusing for the planner to have so many people who are not part of the wedding party and wondering who's who.
WHERE & WHEN
The rehearsal should always take place at your venue location and should preferably be the day before your wedding. You want to ask your venue pretty early on if they have a specific day and time always reserved for rehearsals. Some venues, for example, always schedule their rehearsals the day before at noon. Other venues want you to wait until a month or so before the wedding to schedule your rehearsal to coordinate with any other events that were booked the day before your wedding. Sometimes your venue is unable to accommodate your rehearsal the day before your wedding and so you may have to plan for two days before. This isn't the worst thing but is not ideal. The more time that passes from the rehearsal, the more likely your wedding party is to forget a lot of the details covered.
Some couples opt to do their rehearsal at a different location, especially if their venue is farther away, but I do not recommend this at all. You can still run through the activities but the information will not be as detailed. It will be difficult to time/space the processional walk because you aren't able to see and practice on the actual aisle to get the spacing precise. You also won't be able to show your wedding party the different areas and so there may be a bit of confusion the day of about where they're supposed to go. It is better to already plan in advance for yourself and your wedding party to be in that city/state/wherever at least two days before the wedding instead of the day of or night before the wedding.
After your wedding rehearsal, most couples will host a rehearsal dinner either at the wedding venue, a nearby restaurant, or their home. This is just a gathering of your wedding party and family since you are already together and to act as a welcome and thank you for their participation. But this event is completely optional as it is an additional expense for you. For the rehearsal dinner, you can invite whomever you want. You can limit it to just those that were at the wedding rehearsal or open the invitation to other family and friends as well. In that case though, you may want to call it a "welcome party" instead of "rehearsal dinner" since not everyone attended the rehearsal. This dinner can be as casual or formal as you like. It can be catered food in your backyard or a plated dinner at a fancy restaurant. Also know that it may not be a literal "dinner" depending on the time of your wedding rehearsal. If your wedding rehearsal is in the morning or early afternoon, you may be doing more of a lunch instead. Either way, you will want to start planning for this at least three months beforehand.