This is called Gerrymandering.
its name comes from a politician Gerry who first prepared a gerrymandered map. It can regroup a district so that without changing the votes of the people one or the other party wins, for example if it distributes the democrats into many districts where they are a minority - their votes will "disappear", they will not have any representation, because they are a minority in each district, However, if all those votes are in the same district, they would be a majority in this district and have some representation