How does agriculture release so much greenhouse gas?
There are several contributing factors, 


livestock, Livestock is easy animals produce co2 but their methane is a bigger problem, methane is a better greenhouse gas than the co2 that the feed plants took in.   Livestock waste is also a problem , people do not realize how much waste modern factory farms produce, specially when stored as a liquid is it produces all the problems of rice production with addition release of methane from the waste itself. 
transportation, transportation of ag products to market are almost all petroleum based. Depending on the source this may or may not be included in agricultural emissions.  
Landuse, changing land, especially things like draining wetlands and burning forest for farmland are big contributors, Wetlands in particular produce huge amounts of co2 and keep doing so for decades if not centuries, all the organics built up in wetland start oxidizing when drained, this is basically the same as burning petroleum without actually getting any usable energy out of it. 
Fertilizer produces a plethora of problems, and could justify an question all its own. 
Rice, rice production has been called out as particularly problematic.  You would think this would produce the opposite effect to draining wetland but it is actually worse. Bacteria in flooded soil produces methane instead of co2 and as I said methane is better greenhouse gas, too top it off rice fields are supplied with enough nutrients to keep the bacteria producing way above normal wetland levels and keep it from being trapped the way carbon in mostly anaerobic wetlands will be. 


Source