The airline that flies the plane is the operating carrier; the one whose flight number is on the booking is the marketing carrier. A flight booked under an Iberia number might be flown by British Airways, with BA's crew, aircraft, seats and catering. Booking sites and confirmations should say "operated by" next to the flight.
On the day, the operating airline is in charge. Check in with it, look for its name on the departures board, and expect its cabin bag rules. Departure screens often list one flight under several numbers, which is codesharing at its most visible. Checked bag allowances depend on the whole ticket, so go by the allowance on the booking rather than either airline's general rules.
Changes and refunds usually go through whoever sold the ticket: the airline whose e-ticket number it is, or the travel agent. The operating airline keeps its own copy of the booking, often under a different booking reference, which is the one to use on its website for seats or frequent flyer details.
A codeshare is not the same as an interline trip, though the two often come together. Codesharing is selling a partner's flight under your own flight number; interlining is the agreement that lets two airlines' flights sit on one ticket, with bags checked through.
IB 7362 · London Heathrow to Madrid · Operated by British Airways
Where you'll find it
On the booking confirmation and itinerary, next to the flight number, as "operated by" another airline. Boarding passes often show both flight numbers.