This is a wood trim that finishes the bottom of wall cabinets, specifically to hide lights mounted beneath the cabinetry.
While light rail molding is not necessary for undercabinet lighting, it cleans up the look to not see any power cords or fixtures at the bottom of the cabinet. The trim can help obscure any excess glare from the direct light. Light rail molding can also be decorative as well as functional; different edge trims are available to complete the overall look of your cabinets.