How (and why) are random forests able to represent both linear and non linear data
Decision Trees are able to create both linear and nonlinear boundaries and so are Random Forests.

This is because of how they cluster the data based on nested "if-else" statements. These statements draw vertical/horizontal lines between the samples and cluster them in rectangles. Consecutively, rectangles of the same class can be far away from each other (with other class rectangles in between) but still they belong to the same class. This is how nonlinear relations are modeled.