Dual inline package switch (or “DIP switch”) are small “switches” (like light switches on a wall) to control the flow of electricity. In binary computing, typically the presence of an electrical flow is interpreted as “1” and the lack of flow is interpreted as “0.” For switches that are used often, one would prefer large “lever switches” that are easy to flip (like in the front panel of the famous Altair 8800), but take up a lot of physical space. But for seldomly changed options, DIP switches are essentially the smallest switches that can still be interacted with by human hands (albeit with a toothpick or an awl tool).
The IBM PC 5150 has two groups of these dip switches, located between the power supply and expansion slots, behind the disk drives. These set things like the NUMBER OF DISK DRIVES, DEFAULT TYPE OF VIDEO (MDA vs CGA), and AMOUNT OF MAIN MEMORY.

The specific arrangement and corresponding meaning of the switches are explained in the IBM (5150) Technical Reference manual (here is an example from the early 1981 print of that manual):


Here is my attempt to summarize this information:

The SW2 DIP switch is a little harder to explain, as it depends on Early-Model (64KB) vs Model B (256KB) type of 5150 motherboard. These switches can be used to limit the amount of RAM visible to DOS, such as to test the minimum amount of RAM required by a software application.


You’d have to hunt through different revisions of the IBM manuals to determine this. So, an existing online resource for this information is available here:
http://minuszerodegrees.net/5150/misc/5150_motherboard_switch_settings.htm