Diamondbacks general manager Dave Stewart said his team was "seeking a little bit more offense."
"We felt there was a need to do" this deal, he said on a conference call.
The Diamondbacks ranked second among NL teams in scoring last year. They traded outfielder Ender Inciarte, who hit .303 with 21 steals, to Atlanta in the Miller deal.
The 25-year-old Segura hit .257 with six homers, 50 RBIs and 25 steals last season.
Segura was an All-Star in 2013 with Milwaukee after a big start to his first full season in the majors. He dipped after the break and then slumped the following year.
Segura was one of the players traded from the Angels to Milwaukee for Greinke in 2012.
Stewart said Segura was someone who could hit at the top of the Arizona lineup, depending on how he did.
Segura is a career .266 hitter with 96 steals since making his big league debut in 2012 with the Angels.
Nick Ahmed started 116 times at shortstop for Arizona last year. Known much more for his glove than bat, he hit .226.
With Hill gone, Chris Owings figures to get a full-time shot at second base.
Stewart said having extra middle infielders could lead to more trade possibilities. He said the team was looking at middle relievers and closers, and that he'd already gotten a text from another GM asking how this trade might impact other moves.
Segura's departure creates space for Milwaukee's top prospect, Orlando Arcia, to crack the big league roster at some point soon. The 21-year-old is among the top shortstop prospects in the minors. He's touted for his advanced defense and hit .307 with eight home runs, 69 RBI and 25 stolen bases with Double-A Biloxi last season.
The 28-year-old Anderson was 6-6 with a 4.30 ERA in 27 starts last season. Hill, who turns 34 in March, has played 11 seasons in the majors and has hit .429 with four home runs in 10 career games at Miller Park.
"In Chase Anderson and Aaron Hill, we are adding two proven major league contributors who will impact our team this year," Brewers general manager David Stearns said in a statement.
"Chase is a young starting pitcher who has already enjoyed success at the major league level. Aaron has a long history of production and positional versatility," he said. "In addition, we are excited to be able to add Isan Diaz to our growing supply of high upside minor league talent."
Wagner made his major league debut last season. The 25-year-old was 0-2 with a 7.24 ERA in three starts.
The 19-year-old Diaz hit .360 with 13 home runs and 51 RBI at rookie level Missoula. He was the Pioneer League MVP.