Process by which macrophages adopt different functional programs in response to signals from their microenvironment