The earned income credit is first calculated (actually looked up in a table) on your earned income then it is calculated on your total income (AGI). You get the lesser of the two calculated EIC numbers. See the EIC table at:
https://apps.irs.gov/app/vita/content/globalmedia/earned_income_credit_table_1040i.pdf
The EIC works on a "bell curve," rising as a worker's wages rise reaching a maximum when annual earnings are between $14,800 and $19,350 (Single with 2 or 3 children 2020) and then declining gradually until it phases out altogether. If your income is on the up slope of the EIC curve, less AGI will not increase your EIC. But if your income is on the down slope, less AGI will increase your EIC. See the curve (graph) at:
http://www.taxpolicycenter.org/briefing-book/key-elements/family/eitc.cfm