What permissions do I need if database a contains a stored procedure that inserts into a table in database b (same machine)?
if the procedure uses execute as owner then the owner of the proc needs rights to database b and the table in database b.
if the procedure does not use execute as owner then the calling user needs rights to database b and the table in database b.
if cross-database ownership is on, then "it depends"
here is a link that speaks to options there:
Cross-Database Ownership Chaining