After a breakout season that saw Max Valles put up 9.0 sacks, he made the decision to leave Virginia and enter the 2015 NFL draft despite a year of eligibility left. It was said several times that another year in college could have done him some good and he ended up falling into the 6th round because of it, where the Raiders selected him.
Valles showed his rawness in training camp and he was unable to make the regular season roster. The Raiders instead opted to sign him to the practice squad to allow him to take a year to develop. The Bills apparently think he is ready now signed him off the Raiders practice squad, replacing cornerback Stephon Gilmore who they placed on season ending injured reserve.
This means that Valles will have to be placed on the Bills active roster. It's possible the Bills are just looking to get ahead of the curve with Valles, picking him up before anyone else can. If they too saw potential in Valles in last year's draft, they essentially steal the draft pick back from the Raiders.
That's the risk teams run when they stash players on the practice squad to develop. The Raiders have certainly signed players off of other team's practice squads as well. Jamize Olawale comes to mind.