They were also originally a cavalry amongst the ranks of the Orks in the universe of Warhammer 40,000, roughly akin to the Rough Riders. That role has been pushed out of explicit canon due to 40K's increased efforts to focus on its own identity, rather than the "Warhammer Fantasy IN SPACE" angle it held during its Rogue Trader days.
The Orcs of the Old World had realized very early in their histories that cavalry were a useful thing. After all, they could get you into the fight right quick, so they could. But they couldn't be riding horses like pansy elves and humans. So, they looked for something tougher, something nastier, something... a hell of a lot more orcy! Also something that could put up with their stench and their rough antics, but that's beside the point.
They found what they were looking for in the form of the warboar; particularly large, savage and ill-tempered swine that roam the Old World in huge herds. It's unknown when orc and boar first came to live together, but since the notoriously traditionalist stone-wielding Savage Orcs are willing to ride them, it's clearly been going on a long time.
Boarboyz have a difficult time breaking in their reluctant steeds, with the regime mostly consisting of headbutting them into semi-consciousness, then clambering onto their backs and hanging on for dear life until the boar learns to accept them there. Even then, they have only minimal control over their steeds in battle, which forbids them from using fancier weaponry like lances; an orc needs one hand to hold his choppa and the other to hold onto his boar! Only the Savage Orcs are willing to try dual-wielding choppas from boarback, and other orcs think that they're crazy for trying.
In the 41st millenium, Boarboyz are usually only found amongst Feral Orks and the Snakebite clan, who rely on them as cavalry or to pull the techno-barbarian equivalent of chariots. It's not really clear where they get them from, since they don't pop out of the fungus groves like the squigs do
On rare occasions, warboars will be modified with implants and bionics to make them faster, stronger and tougher. These boars are called "Cyboars". The most rare and powerful Cyboars are the "Super Cyboars". These are more machine then boars, and only Warbosses ride them.
Boarboyz are usually the Feral Orks answer to the Ork Speed Freekz, as they both enjoy the mayhem of going really fast and running people over. The Boarboy that rides upon the Warboar is usually armed with a small ranged weapon, such as a spear or bow, and a close range weapon, usually a Choppa or a Bangstikk, if available.
Orks that have developed a higher level of technology may use other small ranged weapons such as a Slugga or a Shoota. The riders may also be armed with anti-infantry fragmentation Stikkbombs or anti-armour Krak Stikkbombs. When a Nob or a Warboss rides a Warboar into battle they can choose from nearly all of the weapons present within their tribe or clan's armory.