It differed massively from city to city, and between different guilds, but I'll answer for late medieval Scotland. The short answer in any case is that sometimes, guilds would work well together, but other times, there could be rivalry between the groups.
Naturally, guilds would work together to attain common goals: debating legislation, pooling resources for buildings and pageantry. However, in any situation that has different parties competing, strife could certainly arise. For instance, in Dundee, guilds would band together when it suited them, such as organising parades for the patron saints together, combining their strengths to make it a great event. You can guess it: the guilds started squabbling over who went first and who was at the end of the parade, feeling slighted when a particular guild took precedence over the other. A hilarious consequence of this rivalry was found in the church decoration, where the baxters (bakers) had painted 'Bread is the Staff of Life' over their pews, after which the fleshers (butchers) countered with 'Man Shall not Live by Bread Alone' in their area. Guilds, like many groups in history, would work together when it suited them but were always ensuring their own precedence.
Patricia Dennison, 'Power to the People: The Myth of the Medieval Burgh Community', Scottish Power Centres from the Early Middle Ages to the Twentieth Century, pp. 100-131.